package com.jeff.tianti.cms.dao;

import com.jeff.tianti.cms.entity.CnaaApplyFor;
import com.jeff.tianti.common.PageBean;
import com.jeff.tianti.common.dao.CommonDao;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

/**
 * @author xujianfang
 * @desc CnaaApplyForDao�ӿ�
 * @date 2019-07-05
 */
public interface CnaaApplyForDao extends CnaaApplyForDaoCustom, CommonDao<CnaaApplyFor, String> {
    @Query(" from CnaaApplyFor c where c.deleteFlag = 0 and c.auditFlag = 1 and level = ?1 order by c.sort desc,c.createDate desc")
    Page<CnaaApplyFor> findAllNoDel(String level, Pageable pageable);

    @Query(" from CnaaApplyFor c where sort=(select max(sort) from CnaaApplyFor) ")
    CnaaApplyFor findMaxSort();
}